import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ApprovalHistoryDto } from './dto/models';

@Injectable({
  providedIn: 'root'
})
export class ApprovalHistoryService {
  private apiUrl = '/api/app/approval-history';

  constructor(private http: HttpClient) { }

  create(input: any): Observable<ApprovalHistoryDto> {
    return this.http.post<ApprovalHistoryDto>(this.apiUrl, input);
  }

  getListByInboundId(inboundId: string): Observable<ApprovalHistoryDto[]> {
    return this.http.get<ApprovalHistoryDto[]>(`${this.apiUrl}/by-inbound/${inboundId}`);
  }
} 